package cn.oms.auth.api.dto.req;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
// Vo  Value Object
public class RegisterReq {

    //Spring Validation框架通过注解约束属性格式
    @NotBlank(message = "用户名不能为空")
    private String username;
    @NotBlank(message = "邮箱不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$",message = "邮箱格式不正确")
    private String email;
    @NotBlank(message = "验证码不能为空")
    private String verification;
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^\\w{6,20}$",message = "密码必须是6到20个数字,字母,_")
    private String password;
    @NotBlank(message = "确认密码不能为空")
    private String confirm;

}
